﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ProgNetComponents.Design.Attributes
{
    /// <summary>
    /// BrowsableAttribute(false) if Property value is of one of Type from types array
    /// </summary>
    public class DynamicHiddenByTypeAttribute : DynamicTypeDependentAttribute
    {
        public DynamicHiddenByTypeAttribute(string PropertyName, params Type[] types)
            : base(PropertyName, types)
        {

        }

        protected override Attribute GetAttribute(bool TypesMatch)
        {
            if (TypesMatch)
                return System.ComponentModel.BrowsableAttribute.No;
            return null;
        }
    }
}
